package app.server.project.main.service.db.dao.user;

import app.server.project.main.service.db.entity.user.CMSUserEntity;
import app.server.project.main.service.db.mapper.user.CMSUserMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

@Repository
public class CMSUserDao extends ServiceImpl<CMSUserMapper, CMSUserEntity> {


    public boolean hasUser(String username, String password) {
        return this.count(Wrappers.lambdaQuery(CMSUserEntity.class)
                .eq(CMSUserEntity::getPwd, password)
                .eq(CMSUserEntity::getUserName, username)) > 0;
    }


}
